<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>-.-</title>
			<link href="styles/global.css" rel="stylesheet" type="text/css" media="all" />
			<!-- <script type="text/javascript" charset="utf-8" src="../plugins/kindeditor/kindeditor.js"></script>
			<script type="text/javascript" charset="utf-8" src="../plugins/kindeditor/lang/zh_CN.js"></script> -->
			<script type="text/javascript" src="scripts/jquery.min.js"></script>
			<script type="text/javascript" src="scripts/bootstrap.min.js"></script>
			<script type="text/javascript" src="scripts/jquery-1.10.2.min.js"></script>
			<script type="text/javascript" src="scripts/bootstrapValidator.js"></script>
			<link href="styles/bootstrap.min.css" rel="stylesheet" />
			<link href="styles/bootstrapValidator.css" rel="stylesheet" />
<script type="text/javascript">
$(document).ready(function() {
    $('#updateForm').bootstrapValidator({
        message: 'This value is not valid',
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            "furnitureInfo.furnitureName": {
                message: 'The username is not valid',
                validators: {
                    notEmpty: {
                        message: '商品名称不能为空'
                    },
                    stringLength: {
                        min: 6,
                        max: 255,
                        message: '商品名称要大于6位'
                    },
                }
            },
            "furnitureInfo.furnitureId": {
                message: 'The furnitureInfo.furnitureId is not valid',
                validators: {
                    notEmpty: {
                        message: '商品ID不能为空'
                    },
                    stringLength: {
                        min: 6,
                        max: 30,
                        message: '商品ID要大于6位小于30位'
                    },
                    regexp: {
                        regexp: /^[A-Za-z0-9]+$/,
                        message: '商品ID只能是数字和字母'
                    }
                }
            },
            "furnitureInfo.basePrice": {
                message: 'The furnitureInfo.furnitureId is not valid',
                validators: {
                    notEmpty: {
                        message: '采购价格不能为空'
                    },
                    stringLength: {
                        min: 1,
                        max: 10,
                        message: '采购价格不能超过10位'
                    },
                    regexp: {
                        regexp: /^[0-9.]+$/,
                        message: '采购价格格式错误'
                    } 
                }
            },
            
            "furnitureInfo.salePrice": {
                message: 'The furnitureInfo.salePrice is not valid',
                validators: {
                    notEmpty: {
                        message: '销售价格不能为空'
                    },
                    stringLength: {
                        min: 1,
                        max: 10,
                        message: '销售价格不能超过10位'
                    },
                     regexp: {
                        regexp: /^[0-9.]+$/,
                        message: '销售价格格式错误'
                    }
                }
            },
            "furnitureInfo.amount": {
                message: 'The furnitureInfo.amount is not valid',
                validators: {
                    notEmpty: {
                        message: '库存量不能为空'
                    },
                    stringLength: {
                        min: 1,
                        max: 10,
                        message: '库存量不能超过10位'
                    },
                    regexp: {
                        regexp: /^[0-9]+$/,
                        message: '库存量格式错误'
                    }
                }
            },
            
            "furnitureInfo.description": {
                validators: {
                    notEmpty: {
                        message: '描述不能为空'
                    }
                }
            },

        }
    });
});
</script>

</head>
<body>
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h4 class="modal-title" id="myModalLabel">修改商品</h4>
	</div>
	<div class="modal-body">
			<form id="updateForm" action=" FurnitureInfo_updateFurnitureInfo.action "  method="post" class="form-horizontal">
					 <div id="myTabContent" class="tab-content" style="margin: 20px">
					<div class="tab-pane fade in active" id="info">
                        <fieldset>

				    <div class="form-group">
                                <label class="col-lg-3 control-label">家具名称:</label>
                                <div class="col-lg-5">
									<input  type="hidden"  class="form-control"   name="furnitureInfo.objId"  value="<s:property value="#session.furnitureInfo.objId"/>" />
									<input type="text"  class="form-control"  name="furnitureInfo.furnitureName"  value="<s:property value="#session.furnitureInfo.furnitureName"/>"/>
								</div>
					</div>
					<div class="form-group">
                                <label class="col-lg-3 control-label">家具编号:</label>
                                <div class="col-lg-5">
									<input type="text"  class="form-control"  name="furnitureInfo.furnitureId"  value="<s:property value="#session.furnitureInfo.furnitureId"/>"/>
								</div>
					</div>
					<div class="form-group">
									
									<div class="col-lg-5">
										 <input type="hidden" class="form-control" name="furnitureInfo.picture_one" id="name" value="<s:property value="#session.furnitureInfo.picture_one"/>">
									
									</div>
							</div>
					<div class="form-group">
                                <label class="col-lg-3 control-label">家具库存量:</label>
                                <div class="col-lg-5">
									<input type="text"  class="form-control"  name="furnitureInfo.amount"  value="<s:property value="#session.furnitureInfo.amount"/>"/>
								</div>
					</div>
					
					<div class="form-group">
                                <label class="col-lg-3 control-label">家具市场价:</label>
                                <div class="col-lg-5">
									<input type="text"   class="form-control" name="furnitureInfo.marketPrice"  value="<s:property value="#session.furnitureInfo.marketPrice"/>"/>
									<!-- 隐藏域 -->
									<input type="hidden" name="furnitureInfo.saleCount"  value="<s:property value="#session.furnitureInfo.saleCount"/>"/>
								</div>
					</div>
					
					<div class="form-group">
                                <label class="col-lg-3 control-label">家具销售价:</label>
                                <div class="col-lg-5">
									<input type="text"  class="form-control"  name="furnitureInfo.salePrice"  value="<s:property value="#session.furnitureInfo.salePrice"/>"/>
								</div>
					</div>
					<div class="form-group">
                                <label class="col-lg-3 control-label">家具上架时间:</label>
                                <div class="col-lg-5">
									<input  class="form-control"   name="furnitureInfo.createTime"  type="text"  readonly="readonly" value="<s:date name="#session.furnitureInfo.createTime" format="yyy-MM-dd"/>"/>
								</div>
					</div>					
					
					<div class="form-group">
                                <label class="col-lg-3 control-label">商品描述:</label>
                                <div class="col-lg-5">
									<textarea name="furnitureInfo.description"  class="form-control"   id="editor_id" style="width:100%;height:150px;"><s:property value="#session.furnitureInfo.description"/></textarea>
								</div>
					</div>
					
					
					
					
					     <div class="form-group">
                                <label class="col-lg-3 control-label">商品分类</label>
                                	<div class="col-lg-5">
								    <select class="form-control"  name="furnitureInfo.theCategory.id">
											      			<option>-请选择-</option>
											      			<s:iterator value="#session.categoryList">
											      				<option value='<s:property value="id"/>' 
											      						<s:if test="#session.furnitureInfo.theCategory.id==id">
											      							selected="selected"
											      						</s:if>		
											      				><s:property value="type"/></option>
															</s:iterator>						
                                    </select>
                                </div>
                         </div>
     					<div class="form-group">
                                <label class="col-lg-3 control-label">商品状态</label>
                                	<div class="col-lg-5">
								    <select class="form-control"  name="furnitureInfo.status">
											      			<option value="2" 
													      			<s:if test="#session.furnitureInfo.status==2">
													      							selected="selected"
													      						</s:if>	
											      			>下架</option>
											      			<option value="1" 
													      			<s:if test="#session.furnitureInfo.status==1">
													      							selected="selected"
													      						</s:if>	
											      			>销售中</option>
																			
                                    </select>
                                </div>
                         </div>                     
                         
                         
                         
						<div class="form-group">
                            <div class="col-lg-9 col-lg-offset-3">
                                <button type="submit" class="btn btn-primary" >修改</button>
                               <button type="button" class="btn btn-default" data-dismiss="modal" onclick="window.close();">取消</button>
                            </div>
                        </div>
				</div>
		</form>
	</div>



</body>

</html>